import request from '@/utils/request'

export function createApi(postData) {
  return request({
    url: '/account',
    method: 'post',
    data: postData
  })
}
export function deleteByIdApi(id) {
  return request({
    url: `/account/${id}`,
    method: 'DELETE'
  })
}

export function modifyByIdApi(id, data) {
  return request({
    url: `/account/${id}`,
    method: 'PUT',
    data: data
  })
}

export function modifyStatusByIdApi(id) {
  return request({
    url: `/account/status/${id}`,
    method: 'PUT',
  })
}

export function getListApi() {
  return request({
    url: '/account/list',
    method: 'get'
  })
}

export function getPageApi(queryOption) {
  return request({
    url: '/account',
    method: 'get',
    params: queryOption
  })
}

export function modifyPasswordApi(postData) {
  return request({
    url: '/account/modifyPassword',
    method: 'post',
    data: postData,
  })
}

export function logoutApi() {
  return request({
    url: '/account/logout',
    method: 'get'
  })
}

export function resetPasswordApi(id) {
  return request({
    url: `/account/resetPassword/${id}`,
    method: 'put'
  })
}

export function  getAccountRoleIdListApi(accountId) {
  return request({
    url: `/accountRole/${accountId}`,
    method: 'get'
  })
}